<script>
	var request = null,
		api = null,
		utils = null;
	var iswe7 = 1;
	wx.setStorage({
		key: 'iswe7',
		data: iswe7
	});
	"undefined" != typeof wx && (request = require("./utils/request.js"), api = require("./api.js"), utils = require(
		"./utils/utils.js"));
	"undefined" != typeof my && (_app.setRequire(), _app.setApi());

	export default {
		globalData: {
			
		},
		onLaunch: function(e) {
			if (iswe7 == 1) {
				this.$scope.globalData = {
					is_on_launch: !0,
					onShowData: null,
					_version: "1.1.1",
					query: null,
					saveFormId: function(e) {
						this.request({
							url: api.user.save_form_id,
							data: {
								form_id: e
							}
						});
					},
					loginBindParent: function(e) {
						if ("" == this.hj.getStorageSync("access_token")) return !0;
						this.bindParent(e);
					},
					bindParent: function(e) {
						var t = this;
					
						if ("undefined" != e.parent_id && 0 != e.parent_id) {
							var i = t.hj.getStorageSync("user_info");
							if (0 < t.hj.getStorageSync("share_setting").level) 0 != e.parent_id && t.request({
								url: api.share.bind_parent,
								data: {
									parent_id: e.parent_id
								},
								success: function(e) {
									0 == e.code && (i.parent = e.data, t.hj.setStorageSync("user_info", i));
								}
							});
						}
					},
					shareSendCoupon: function(i) {
						var a = this;
						a.hj.showLoading({
							mask: !0
						}), i.hideGetCoupon || (i.hideGetCoupon = function(e) {
							var t = e.currentTarget.dataset.url || !1;
							i.setData({
								get_coupon_list: null
							}), t && a.hj.navigateTo({
								url: t
							});
						}), this.request({
							url: api.coupon.share_send,
							success: function(e) {
								0 == e.code && i.setData({
									get_coupon_list: e.data.list
								});
							},
							complete: function() {
								a.hj.hideLoading();
							}
						});
					},
					getauth: function(t) {
						var i = this;
						i.hj.showModal({
							title: "是否打开设置页面重新授权",
							content: t.content,
							confirmText: "去设置",
							success: function(e) {
								e.confirm ? i.hj.openSetting({
									success: function(e) {
										t.success && t.success(e);
									},
									fail: function(e) {
										t.fail && t.fail(e);
									},
									complete: function(e) {
										t.complete && t.complete(e);
									}
								}) : t.cancel && i.getauth(t);
							}
						});
					},
					setApi: function() {
						var a = this.siteInfo.siteroot;
						a = a.replace("app/index.php", ""), // console.log(a)
							a += "addons/remao_shop/api//index.php?r=", // a += "addons/remao_shop/api/index.php?r=",
							// console.log(a)
							this.api = function e(t) {
								for (var i in t) "string" == typeof t[i] ? t[i] = t[i].replace("{$_api_root}", a) : t[i] = e(t[i]);
					
								return t;
							}(this.api);
						var e = this.api.default.index; 
					},
					webRoot: null,
					siteInfo: require("./siteinfo.js"),
					currentPage: null,
					pageOnLoad: function(e, t) {
						this.page.onLoad(e, t);
					},
					pageOnReady: function(e) {
						this.page.onReady(e);
					},
					pageOnShow: function(e) {
						this.page.onShow(e);
					},
					pageOnHide: function(e) {
						this.page.onHide(e);
					},
					pageOnUnload: function(e) {
						this.page.onUnload(e);
					},
					setNavigationBarColor: function() {
						var e = this.hj.getStorageSync("_navigation_bar_color");
						e && this.hj.setNavigationBarColor(e);
					},
					loginNoRefreshPage: ["pages/index/index", "mch/shop/shop"],
					navigatorClick: function(e, t) {
						var i = e.currentTarget.dataset.open_type;
						if ("redirect" == i) return !0;
					
						if ("wxapp" == i) {
							var a = e.currentTarget.dataset.path;
							"/" != a.substr(0, 1) && (a = "/" + a), this.hj.navigateToMiniProgram({
								appId: e.currentTarget.dataset.appid,
								path: a,
								complete: function(e) {}
							});
						}
					
						if ("tel" == i) {
							var n = e.currentTarget.dataset.tel;
							this.hj.makePhoneCall({
								phoneNumber: n
							});
						}
					
						return !1;
					},
					util: require("./we7/resource/js/util.js"),
					request: request,
					api: api,
					utils: utils,
					setRequire: function() {
						this.request = require("./utils/request.js"), this.api = require("./api.js"), this.utils = require(
							"./utils/utils.js");
					},
					getPlatform: function() {
						return "undefined" != typeof my ? "my" : "undefined" != typeof wx ? "wx" : null;
					}
				}
			} else {
				this.$scope.globalData = {
					is_on_launch: !0,
					onShowData: null,
					_version: "1.1.1",
					query: null,
					saveFormId: function(e) {
						this.request({
							url: api.user.save_form_id,
							data: {
								form_id: e
							}
						});
					},
					loginBindParent: function(e) {
						if ("" == this.hj.getStorageSync("access_token")) return !0;
						this.bindParent(e);
					},
					bindParent: function(e) {
						var t = this;
					
						if ("undefined" != e.parent_id && 0 != e.parent_id) {
							var i = t.hj.getStorageSync("user_info");
							if (0 < t.hj.getStorageSync("share_setting").level) 0 != e.parent_id && t.request({
								url: api.share.bind_parent,
								data: {
									parent_id: e.parent_id
								},
								success: function(e) {
									0 == e.code && (i.parent = e.data, t.hj.setStorageSync("user_info", i));
								}
							});
						}
					},
					shareSendCoupon: function(i) {
						var a = this;
						a.hj.showLoading({
							mask: !0
						}), i.hideGetCoupon || (i.hideGetCoupon = function(e) {
							var t = e.currentTarget.dataset.url || !1;
							i.setData({
								get_coupon_list: null
							}), t && a.hj.navigateTo({
								url: t
							});
						}), this.request({
							url: api.coupon.share_send,
							success: function(e) {
								0 == e.code && i.setData({
									get_coupon_list: e.data.list
								});
							},
							complete: function() {
								a.hj.hideLoading();
							}
						});
					},
					getauth: function(t) {
						var i = this;
						i.hj.showModal({
							title: "是否打开设置页面重新授权",
							content: t.content,
							confirmText: "去设置",
							success: function(e) {
								e.confirm ? i.hj.openSetting({
									success: function(e) {
										t.success && t.success(e);
									},
									fail: function(e) {
										t.fail && t.fail(e);
									},
									complete: function(e) {
										t.complete && t.complete(e);
									}
								}) : t.cancel && i.getauth(t);
							}
						});
					},
					setApi: function() {
						var a = this.siteInfo.siteroot;
						a = a.replace("app/index.php", ""), // console.log(a)
							a += "", // a += "addons/remao_shop/api/index.php?r=",
							// console.log(a)
							this.api = function e(t) {
								for (var i in t) "string" == typeof t[i] ? t[i] = t[i].replace("{$_api_root}", a) : t[i] = e(t[i]);
					
								return t;
							}(this.api);
						var e = this.api.default.index; // console.log(e)
						// var t = e.substr(0, e.indexOf("/index.php"));
						// this.webRoot = t;
					},
					webRoot: null,
					siteInfo: require("./siteinfos.js"),
					currentPage: null,
					pageOnLoad: function(e, t) {
						this.page.onLoad(e, t);
					},
					pageOnReady: function(e) {
						this.page.onReady(e);
					},
					pageOnShow: function(e) {
						this.page.onShow(e);
					},
					pageOnHide: function(e) {
						this.page.onHide(e);
					},
					pageOnUnload: function(e) {
						this.page.onUnload(e);
					},
					setNavigationBarColor: function() {
						var e = this.hj.getStorageSync("_navigation_bar_color");
						e && this.hj.setNavigationBarColor(e);
					},
					loginNoRefreshPage: ["pages/index/index", "mch/shop/shop"],
					navigatorClick: function(e, t) {
						var i = e.currentTarget.dataset.open_type;
						if ("redirect" == i) return !0;
					
						if ("wxapp" == i) {
							var a = e.currentTarget.dataset.path;
							"/" != a.substr(0, 1) && (a = "/" + a), this.hj.navigateToMiniProgram({
								appId: e.currentTarget.dataset.appid,
								path: a,
								complete: function(e) {}
							});
						}
					
						if ("tel" == i) {
							var n = e.currentTarget.dataset.tel;
							this.hj.makePhoneCall({
								phoneNumber: n
							});
						}
					
						return !1;
					},
					// util: require("we7/resource/js/util.js"),
					request: request,
					api: api,
					utils: utils,
					setRequire: function() {
						this.request = require("./utils/request.js"), this.api = require("./api.js"), this.utils = require(
							"./utils/utils.js");
					},
					getPlatform: function() {
						return "undefined" != typeof my ? "my" : "undefined" != typeof wx ? "wx" : null;
					}
				}
			}
			this.$scope.globalData.setApi(), api = this.$scope.globalData.api;
		},
		onShow: function(e) {
			e.scene && (this.$scope.globalData.onShowData = e), e && e.query && (this.$scope.globalData.query = e.query);
		},
		methods: {}
	};
</script>
<style>
	@import "./app.css";
</style>
